package com.itheima.sc.service.ums;

import com.itheima.sc.api.ums.ResourceCategoryApi;
import com.itheima.sc.pojo.ums.UmsResourceCategory;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UmsResourceCategoryService {
    @DubboReference
    private ResourceCategoryApi resourceCategoryApi;

    /**
     * 添加后台资源分类
     */
    public void create(UmsResourceCategory umsResourceCategory) {
        resourceCategoryApi.create(umsResourceCategory);
    }

    /**
     * 根据ID删除后台资源
     */
    public void delete(Integer id) {
        resourceCategoryApi.delete(id);
    }

    /**
     * 查询所有后台资源分类
     */
    public List<UmsResourceCategory> listAll() {
        return resourceCategoryApi.listAll();
    }

    /**
     * 修改后台资源分类
     */
    public void update(UmsResourceCategory umsResourceCategory) {
        resourceCategoryApi.update(umsResourceCategory);
    }
}
